<?php
namespace App\Models;

use App\Models\Tools\AliOss;
use Illuminate\Support\Facades\DB;

class Goods
{
    /**
     * 查询抽奖奖品信息
     * @param $goods_id
     * @return mixed
     */
    public static function goodsMessage($goods_id)
    {
        $result = DB::table('lottery_goods')->where('goods_id','=',$goods_id)->first();
        $result = json_decode(json_encode($result), true);
        $result['title_img'] = AliOss::getUrl($result['title_img']);
        $result['goods_img'] = AliOss::getUrls(explode(',',$result['goods_img']));
        return $result;
    }

}
